// 回复框中的被回复者
var listenName

// 添加回复
// function addReply(date, content, say, listen){    //时间, 回复内容, 回复者, 被回复者
//     index = $(".shop-pr-comment-response").find(".shop-pr-comment-response-item").length + 1;
//     $(".shop-pr-comment-response").append(`<div class="shop-pr-comment-response-item"><span class="shop-comment-response-serial-number"><span>` + index + `</span></span><div class="shop-pr-comment-response-item-in"><div class="shop-pr-comment-response-item-top"><span class="shop-say-user">`+ say +`</span><span>回复</span><span class="shop-listen-user">` + listen + `</span><span>说:</span><span class="shop-pr-comment-response-item-date">` + date + `</span></div><div class="shop-pr-comment-response-item-bottom"><p>`+ content +`</p></div></div><span class="shop-pr-comment-response-item-reply-btn">回复(0)</span></div>`) 
// }
// 取出回复内容
// function getReplyContent(content, str){
//     var re = new RegExp("^回复："+ str)
//     return content.replace(re, "");
// }

// 回复
// $(".shop-pr-comment-response-item-reply-btn").on("click", function(){
//     var name = $(this).siblings(".shop-pr-comment-response-item-in").find(".shop-say-user").text();
//     $(".shop-pr-post-reply textarea").val("回复：" + name);
//     listenName = name;
// });
// 回复评论
// $(".shop-Reply").on("click", function(){
//     var name = $(".shop-user-name").text().replace(/^\s+|\s+$/g,"");
//     $(".shop-pr-post-reply textarea").val("回复：" + name);
//     listenName = name;
// });

// 回复框显示被回复者
function fillReplyBox(str){
    $(".shop-reply-input-box").attr("placeholder", "回复："+str)
}

// 提示用户还可以输入多少字
$(".shop-reply-input-box").on("input", function(){
    var num = 300 - $(".shop-reply-input-box").val().length
    if(num <= 0){
        $(".shop-reply-input-box").val($(".shop-reply-input-box").val().slice(0, 299));
    }
    $(".shop-enter-remaining > span").text(299 - $(".shop-reply-input-box").val().length);
});